package com.itheima.controller;

import com.itheima.pojo.Report;
import com.itheima.pojo.Result;
import com.itheima.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author hu
 * @date 2025/3/4
 */
@RestController
@Slf4j
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ReportService reportService;

    /**
     * 员工职位人数统计
     * @return
     */
    @GetMapping("/empJobData")
    public Result report() {
        log.info("员工职位人数统计");
        Report report = reportService.getEmpJobData();
        return Result.success(report);
    }

    @GetMapping("/empGenderData")
    public Result reportGenderData(){
        log.info("员工职位性别");
        List<Map<String,Object>> dataList = reportService.getGenderData();
        return Result.success(dataList);
    }

}
